<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 250px;
            height: 251px;
            background-color: sandybrown;
        }
        .inner{
            width: 100px;
            height: 100px;
            background-color: sienna;
        }
    </style>
</head>
<body>
    
    <div id="app">

        <!-- <div class="box" @click="fn">
            <div class="inner" @click.stop="fn1($event)"></div>
        </div> -->
        <!-- <div class="box" @click.self="fn">
            <div class="inner" @click="fn1($event)"></div>
        </div> -->
        <div class="box" @click.capture="fn">
            <div class="inner" @click="fn1($event)"></div>
        </div>

        <a href="http://www.baidu.com" @click.prevent="fn2">百度</a>
        <button @click.once="fn">点我只有一次</button>
    </div>
    
    <script src="../lib/Vue/vue.js"></script>
    <script>

    // 事件修饰符:
	// stop:阻止冒泡,
	// prevent:阻止默认事件,
	// once:只绑定一次,
	// self:使用self实现点击当前元素的时候才触发事件处理函数 可以理解为变相的阻止事件冒泡
	// capture：把冒泡改为捕获
	// v-on:事件名字.事件修饰符
			
	// 键盘修饰符
	 // enter,left,right,down,up,tab,ctrl,meta,alt,shift,delete,esc

        var vm = new Vue({
            
            el: '#app',
            data: {

            },
            methods: {
                fn() {
                    console.log('我是box');
                },
                fn1() {
                    console.log('我是inner');
                },
                fn2() {

                }
            }
        })
    </script>
</body>
</html>